public class ThreadSleep {
    public static void main(String[] args) throws InterruptedException {
        Thread thread=new Thread(()->{
            try {
                Thread.sleep(60*60*1000);
            } catch (InterruptedException e) {
               // e.printStackTrace();
                System.out.println("我接受到了终止的通知");
            }
        });
        thread.start();
        Thread.sleep(1000);
        System.out.println("终止子线程thread");
        thread.interrupt();
    }
}
